home *** CD-ROM | disk | FTP | other *** search
- unit MainU;
-
- interface
-
- uses
- WinProcs, WinTypes, Messages, SysUtils, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls;
-
- type
- TMainForm = class(TForm)
- Label1: TLabel;
- Button1: TButton;
- procedure FormCreate(Sender: TObject);
- procedure Button1Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- MainForm: TMainForm;
-
- implementation
-
- uses OtherU;
-
- {$R *.DFM}
-
- {$ifdef Ver80} { Delphi 1.0x }
- {$define DelphiLessThan3}
- {$endif}
- {$ifdef Ver90} { Delphi 2.0x }
- {$define DelphiLessThan3}
- {$endif}
- {$ifdef Ver93} { C++ Builder 1.0x }
- {$define DelphiLessThan3}
- {$endif}
- procedure TMainForm.FormCreate(Sender: TObject);
- begin
- {$ifdef DelphiLessThan3}
- ShowWindow(Application.Handle, sw_Hide);
- {$else}
- SetWindowLong(
- Application.Handle, gwl_ExStyle,
- GetWindowLong(Application.Handle, gwl_ExStyle) or ws_Ex_ToolWindow)
- {$endif}
- end;
-
- procedure TMainForm.Button1Click(Sender: TObject);
- var
- Loop: Integer;
- begin
- { Create and display 10 secondary forms, }
- { but don't bother about storing their object references }
- for Loop := 1 to 10 do
- TOtherForm.Create(Application).Show;
- { Hide main form }
- Hide
- end;
-
- end.
-